package firefacilitysystem;

import com.alibaba.fastjson.JSONObject;
import fzdy.struct.SmsType;
import fzdy.tools.SmsSender;
import fzdy.tools.SpringContextUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

@ComponentScan(basePackages = "fzdy")
@EntityScan(basePackages = "fzdy/entity")
@SpringBootApplication
@EnableScheduling
@EnableAsync
public class Smstest {
    public static void main(String[] args) {
        ApplicationContext ctx = SpringApplication.run(FirefacilitysystemApplication.class, args);
        SpringContextUtil springContextUtil = new SpringContextUtil();
        springContextUtil.setApplicationContext(ctx);
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("param1","11");
        jsonObject.put("param2","12");
        jsonObject.put("param3","13");
        ((SmsSender)ctx.getBean("smssender")).sendSms(SmsType.Device_FaultAlarm,"13665067280",jsonObject.toString());
    }
}
